/* load the page[url] to the id. */
function loadPageForId(id,page){
    $("#"+id).hide();
    $("#"+id).load(page);
    $("#"+id).fadeIn(1000);
}
/* load the page[url] to the element. */
function loadPage(ele,page){
    (ele).hide();
    (ele).load(page);
    (ele).fadeIn(1000);
}

/**
 * Bind the form for ajax call
 * formId - id of form
 * updatedToId - container id to be updated with response
 */
function bindAjaxForm(formId,updateToId){           
    var options = {
        target:     updateToId,
        url:        $(formId).attr("action"),
        success:    function() {
            //alert('response');
        }
    };
    // pass options to ajaxForm
    $(formId).ajaxForm(options);
}

function url(options, v){
    if(v){      
        if(options.selector != undefined){
           $(options.selector).load(options.url);
        }else{
            window.location=options.url;
        }
    }
}
